package com.glsc.ngateway.platform.domain.costallocation;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.api.common.utils.DateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author guoj
 * @description: 部门成本分摊比例
 * @date 2024/7/18 17:12
 */
@Data
@Entity
@Table(name = "t_dep_costallocation")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class DepCostAllocation {
    @ApiModelProperty(value = "ID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "l_id", columnDefinition = "int(11) comment '系统ID'")
    private Long id;

    @ApiModelProperty(value = "系统信息ID")
    @Column(name = "vc_systeminfo_id", columnDefinition = "varchar(10) comment '系统信息ID'")
    private Long systemInfoId;

    @ApiModelProperty(value = "业务对口部门一级名称")
    @Column(name = "vc_depgradeone_name", columnDefinition = "varchar(50) comment '业务对口部门一级名称'")
    private String depGradeOneName;
    @ApiModelProperty(value = "业务对口部门一级id")
    @Column(name = "vc_depgradeone_id", columnDefinition = "varchar(11) comment '业务对口部门一级id'")
    private String depGradeOneId;
   /* @ApiModelProperty(value = "业务对口部门二级")
    @Column(name = "vc_depgradetwo_name", columnDefinition = "varchar(50) comment '业务对口部门二级'")
    private String depGradeTwoName;
    @ApiModelProperty(value = "业务对口部门二级id")
    @Column(name = "vc_depgradetwo_id", columnDefinition = "varchar(11) comment '业务对口部门二级id'")
    private String depGradeTwoId;*/

    //前端传递过来的为oa的useraccount  oa唯一
    //本地落库需要后端翻译为username 前端查询直接展示
    @ApiModelProperty(value = "业务对口部门责任人")
    @Column(name = "vc_dep_leader", columnDefinition = "varchar(30) comment '业务对口部门责任人'")
    private String depLeader;
    @ApiModelProperty(value = "业务对口部门责任人")
    @Column(name = "vc_dep_leadername", columnDefinition = "varchar(30) comment '业务对口部门责任人名称'")
    private String depLeaderName;
    @ApiModelProperty(value = "分摊比例")
    @Column(name = "en_cost_allocation", columnDefinition = "decimal(20,4) comment '分摊比例'")
    private BigDecimal costAllocation;


    @ApiModelProperty(value = "操作人")
    @Column(name = "vc_operator",columnDefinition = "varchar(30) comment '操作人'")
    private String operator;




    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @org.hibernate.annotations.UpdateTimestamp
    @Column(name = "dt_update_time", columnDefinition = "datetime comment '创建时间'")
    protected LocalDateTime updateTime;

}
